package com.e3.basdoc.cust.client;

import java.util.List;

import com.e3.basdoc.cust.model.CustAccountModel;
import com.e3.basdoc.cust.model.CustModel;
import com.e3.basdoc.cust.model.CustQC;
import com.e3.web.core.client.RPCServiceHelper;
import com.e3.web.core.client.WebException;
import com.extjs.gxt.ui.client.data.PagingLoadConfig;
import com.extjs.gxt.ui.client.data.PagingLoadResult;
import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.rpc.RemoteService;

public interface CustRPCService extends RemoteService {

	public static class Util {

		private static CustRPCServiceAsync instance;

		public static CustRPCServiceAsync getInstance() {
			instance = (CustRPCServiceAsync) RPCServiceHelper.getService(CustRPCService.class.getName());
			if (instance == null) {
				instance = GWT.create(CustRPCService.class);
				RPCServiceHelper.registerServiceEntryPoint(instance);
			}
			return instance;
		}

	}

	CustModel newCust(CustModel custModel) throws WebException;

	List<CustModel> getCustsByCondition(CustQC custQC) throws WebException;

	CustModel modifyCust(CustModel custModel) throws WebException;

	void deleteCusts(List<CustModel> custModels) throws WebException;

	List<CustModel> getCustChildren(CustModel custModel) throws WebException;

	CustModel getCustById(Long id) throws WebException;
	
	PagingLoadResult<CustModel> getPagingCusts(PagingLoadConfig config) throws WebException;

	CustAccountModel createAccountModelInstance() throws WebException;
}
